﻿#pragma once

#include <QItemDelegate>
#include <iostream>
#include <QComboBox>

// 策略视图的代理
class StrategyDelegate : public QItemDelegate
{
	Q_OBJECT

public:
	StrategyDelegate(const QStringList &pStrategyList, QObject *parent);
	~StrategyDelegate();


	QWidget *createEditor(QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index) const;

	void setEditorData(QWidget * editor, const QModelIndex & index) const;

	void setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const;

	void updateEditorGeometry(QWidget * editor, const QStyleOptionViewItem & option, const QModelIndex & index) const;

private:
	QStringList m_strategyNameList;
};
